<?php

include_once("../../commonFunctions.php");
$store = new Store($_SESSION['storeAbbrev']);
$dealer = new Dealer($_SESSION['dealerCode']);

$store = new Store($_SESSION['storeAbbrev']);
$value1 = $_GET['value1'];

$_SESSION['value1'] = $value1;

if ($value1 == "Maintenance") {
    $query = "select distinct type from maintenance;";
    $result = mysql_query($query) or die("failed in maintenance if statement submitNewTT_issue.php");
    while ($row = mysql_fetch_array($result)) {
        echo $row['type'] . ",";
    }
    echo "Maintenance Location: ";

} else if ($value1 == "Merchandising") {
    $query = "select distinct type from merchandising;";
    $result = mysql_query($query) or die("failed in merchandising if statement submitNewTT_issue.php");
    while ($row = mysql_fetch_array($result)) {
        echo $row['type'] . ',';
    }
    echo 'Merchandising Location: ';
} else if ($value1 == "Computer") {
    $query = "select distinct computerAbbrev from computers where storeAbbrev='" . $store->storeAbbrev . "';";
    $result = mysql_query($query) or die("failed in computer if statement submitNewTT_issue.php");
    while ($row = mysql_fetch_array($result)) {
        echo $row['computerAbbrev'] . ',';
    }
    echo 'Computer Label: ';
} else if ($value1 == "storePrinter") {
    $query = "select makeModel from printers where storeAbbrev='" . $store->storeAbbrev . "';";
    $result = mysql_query($query) or die("failed in computer if statement submitNewTT_issue.php");
    while ($row = mysql_fetch_array($result)) {
        echo $row['makeModel'] . ',';
    }
    echo 'Select Printer Type: ';
}
?>
